<!----------------------------------------------------
ページ名：TimetableClassSelection.jsp
所　　属：H3A1 04
名　　前：大瀬碩
説　　明：時間割を表示したいクラスを選ぶページ
------------------------------------------------------>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<title>時間割選択</title>
<style type="text/css">
    <!--
    tr { text-align:center; }
    th { text-align:center; }
    -->
    </style>
</head>
<body>
	<%
	//すでにログインしている場合は所属クラスのページへ飛ばす
	HttpSession ses = request.getSession(true);
	Object class_id = ses.getAttribute("class");
	if(class_id != null){
		out.print("<form name=\"sampleform\" action=\"Timetable\" method=\"POST\">");
		out.print("<input type=\"hidden\" value=\""+class_id+"\" name=\"class\">");
		out.print("<SCRIPT language=\"JavaScript\">document.sampleform.submit();</SCRIPT>");
		out.print("</form>");
	}
	%>
<%
//ログイン状態に応じたナビゲーションバー
Object login = ses.getAttribute("login");

if("OK".equals(login)){
	out.print("<div class=\"navbar navbar-default\">");
	out.print("<div class=\"navbar-header\">");
	out.print("<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">");
	out.print("<span class=\"icon-bar\"></span>");
	out.print("<span class=\"icon-bar\"></span>");
	out.print("<span class=\"icon-bar\"></span>");
	out.print("</button>");
	out.print("<a class=\"navbar-brand\" href=\"index.jsp\"><img src=\"images/logo2.png\"></a>");
	out.print("</div>");
	out.print("<div class=\"navbar-collapse collapse\">");
	out.print("<ul class=\"nav navbar-nav\">");
	out.print("<li class=\"active\"><a href=\"TimetableClassSelection.jsp\">時間割情報</a></li>");
	out.print("<li><a href=\"ClubList.jsp\">部活動情報</a></li>");
	out.print("<li><a href=\"SupplementaryClasses.jsp\">振り替え補講</a></li>");
	out.print("<li><a href=\"HolidayAttendance.jsp\">土日出校申請</a></li>");
	out.print("<li><a href=\"AttendanceHistory.jsp\">出席履歴</a></li>");
	out.print("</ul>");
	out.print("<ul class=\"nav navbar-nav navbar-right\">");
	out.print("<li><a href=\""+request.getContextPath()+"/Logout\">ログアウト</a></li>");
	out.print("</ul>");
	out.print("</div>");
	out.print("</div>");
}else{
	out.print("<div class=\"navbar navbar-default\">");
	out.print("<div class=\"navbar-header\">");
	out.print("<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">");
	out.print("<span class=\"icon-bar\"></span>");
	out.print("<span class=\"icon-bar\"></span>");
	out.print("<span class=\"icon-bar\"></span>");
	out.print("</button>");
	out.print("<a class=\"navbar-brand\" href=\"index.jsp\"><img src=\"images/logo2.png\"></a>");
	out.print("</div>");
	out.print("<div class=\"navbar-collapse collapse\">");
	out.print("<ul class=\"nav navbar-nav\">");
	out.print("<li class=\"active\"><a href=\"TimetableClassSelection.jsp\">時間割情報</a></li>");
	out.print("<li><a href=\"ClubList.jsp\">部活動情報</a></li>");
	out.print("</ul>");
	out.print("<ul class=\"nav navbar-nav navbar-right\">");
	out.print("<li><a href=\"Login.jsp\">ログイン</a></li>");
	out.print("</ul>");
	out.print("</div>");
	out.print("</div>");
}
%>
	<h1 align="center">時間割クラス選択画面</h1>
	<h3 align="center">参照する自クラスを選択してください</h3>
	<div>
		<table class="table">
			<tr>
				<th>１学年</th>
				<th>２学年</th>
				<th>３学年</th>
				<th>４学年</th>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="5" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="5">R1A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="14" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="14">R2A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="22" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="22">R3A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="23" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="23">R4A1</button>
					</form>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="8" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="8">S1A1</button>
					</form>
				</td>
				
				<td>
					
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="17" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="17">S2A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="19" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="19">S3A1</button>
					</form>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="9" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="9">S1A2</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="18" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="18">S2A2</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="20" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="20">S3A2</button>
					</form>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="7" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="7">H1A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="16" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="16">H2A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="21" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="21">H3A1</button>
					</form>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="6" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="6">R1A2</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="15" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="15">R2A2</button>
					</form>
				</td>
				
				<td>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="3" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="3">B1A1</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="12" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="12">B2A1</button>
					</form>
				</td>
				
				<td>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="4" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="4">B1A2</button>
					</form>
				</td>
				
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="13" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="13">B2A2</button>
					</form>
				</td>
				
				<td>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="1" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="1">J1A1</button>
					</form>
				</td>
				
				<td>
				<form action="Timetable" method="post" name="class">
						<input type="hidden" value="10" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="10">J2A1</button>
					</form>
				</td>
				
				<td>
				</td>
				
				<td>
				</td>
			</tr>
			
			<tr>
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="2" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="2">J1A2</button>
					</form>
				</td>
			
				<td>
					<form action="Timetable" method="post" name="class">
						<input type="hidden" value="11" name="class">
						<button type="submit" class="btn" style="WIDTH: 150px; HEIGHT: 40px; font-size: large" value="11">J2A2</button>
					</form>
				</td>
				
				<td>
				</td>
				
				<td>
				</td>
			</tr>
		</table>
	</div>
	
	<div align="center">
		<a href="index.jsp" class="btn btn-lg btn-danger"><i class="glyphicon glyphicon-home"><br>トップへ</i></a>
	</div>
</body>
</html>